<%@ page import="j.framework.qmd.core.QueryManager" %>
<%@ page import="j.framework.qmd.core.QueryFieldMetadata" %>
<%--

  User: 刘军海
  Date: 2014/11/21 16:12
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="j" uri="j/tags" %>
<%@ taglib prefix="st" tagdir="/WEB-INF/tags" %>
<%@ taglib prefix="joyi" uri="http://www.joyi.cn/tags" %>

<%
  String fieldId = request.getParameter("feildid");
  //查询指定字段ID的定义配置
  QueryFieldMetadata qfmd = QueryManager.getQueryMetadata(request.getParameter("queryId")).getFieldMetadata(fieldId);
  request.setAttribute("md",qfmd);
%>

<st:page>
  <div data-options="region:'north',border:false">
    字段名称：${md.fieldName}  显示名称：${md.displayName}  数据类型：${md.dataType}
  </div>
  <div data-options="region:'center',border:false">
    <div id="toolbar">
      <a href="#" id="addStyle" class="easyui-linkbutton" data-options="iconCls:'icon-add'" onclick="addNew(this);">增加Footer</a>
    </div>
    <joyi:dataGrid id="dg" key="query_field_footer" toolbarId="toolbar" params="fieldId=${md.fieldId}"/>
  </div>
  <script>
    function addNew(sender){
      j.open("/user/req?rid=<j:des data="REQ00000000000000011"/>&action=edit&key=${p.queryId}&fieldId=${md.fieldId}","editWin",{},360,300);
    }
    function reload(){
      $("#dg").datagrid("reload");
    }
    function delFooter(footerId){
      if(window.confirm("确认要删除吗？")){
        Http.post("/user/req?rid=<j:des data="REQ00000000000000011"/>&action=delete",{footerId:footerId},function(data){
          alert("删除成功！") ;
          reload();
        });
      }
    }
  </script>
</st:page>
